package innerClass;

public class Test {
    public static void main(String[] args) {
        //了解成员内部类和其特点
        Outer.Inner in = new Outer().new Inner();
        in.test();
        System.out.println("----------------------------------");

        //静态内部类
        Outer.Inner2 in2 = new Outer.Inner2();
        in2.test();
        System.out.println("-------------------------------------------");

        //匿名内部类：特殊的局部内部类，程序员不需要为这个类声明名字
        Animal animal = new Animal() {
            @Override
            public void cry() {
                System.out.println("猫喵喵叫");
            }
        };
        animal.cry();
    }
}

abstract class Animal{
    public abstract void cry();
}
